#ifndef _MEDIATOR_H_
#define _MEDIATOR_H_

/*
	class : Mediator
	desc : This creates a mediator and follows the mediator
		design pattern. It is used to simplify communication
		protocols like usart, spi, and such to make it easier to
		deal with then the previous methods.
*/
template<typename DataInStruct, typename DataOutStruct>
class Mediator
{
	protected :
		DataInStruct dataIn;
		DataOutStruct dataOut;
	virtual void transmission()=0;
	virtual void reception()=0;
	public:
	virtual void init(){}
	virtual void transmit(DataInStruct data){dataIn=data;}
	virtual DataOutStruct receive(){return dataOut;}
	virtual bool finishedReceive(){return false;}
	virtual bool finishedTransmit(){return false;}


	virtual void run(){}
};


#endif
